/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#include "NgExecutor.h"

using namespace PQCore;

namespace PQEngine
{
	SerializeDatagram* NgExecutor::genAddResource(std::string path)
	{
		assert(false);
		return 0;

		/*
		SerializeGenerator gen(GDATA_COMMAND_ADD_RESOURCE);
		gen.addStringParam(path);
		SerializeDatagram *datagram=gen.genDatagram();
		return datagram;
		*/
	}

	SerializeDatagram* NgExecutor::genAddChrModel(std::string path)
	{
		assert(false);
		return 0;

		/*
		SerializeGenerator gen(GDATA_COMMAND_ADD_CHR_MODEL);
		gen.addStringParam(path);
		SerializeDatagram *datagram=gen.genDatagram();
		return datagram;
		*/
	}

	SerializeDatagram* NgExecutor::genAddGPKResoure(std::string path)
	{
		assert(false);
		return 0;
		/*
		SerializeGenerator gen(GDATA_COMMAND_ADD_GPACK_RESOURCE);
		gen.addStringParam(path);
		SerializeDatagram *datagram=gen.genDatagram();
		return datagram;
		*/
	}


	SerializeDatagram* NgExecutor::genCreateObject(ObjectType type)
	{
		assert(false);
		return 0;
		/*
		SerializeGenerator gen(GDATA_COMMAND_CREATE_OBJECT);
		gen.addObjectTypeParam(type);
		
		SerializeDatagram *datagram=gen.genDatagram();
		return datagram;
		*/
	}

	SerializeDatagram* NgExecutor::genCreateTerrainObject(int slotX,int slotY)
	{
		assert(false);

		return 0;
		/*
		SerializeGenerator gen(GDATA_COMMAND_CREATE_TERRAIN_OBJECT);
		gen.addIntParam(slotX);
		gen.addIntParam(slotY);
		
		SerializeDatagram *datagram=gen.genDatagram();
		return datagram;
		*/
	}

	SerializeDatagram* NgExecutor::genCreateLightObject(int lightType)
	{
		assert(false);
		return 0;

		/*
		SerializeGenerator gen(GDATA_COMMAND_CREATE_OBJECT);
		gen.addObjectTypeParam(OBJECT_TYPE_LIGHT);
		gen.addIntParam(lightType);
		
		SerializeDatagram *datagram=gen.genDatagram();
		return datagram;
		*/

	}



	void NgExecutor::exec(char* data,int len)
	{
		assert(false);
		return;
		/*
		SerializeDatagram* datagram=new SerializeDatagram(data,len);
		SerializeParser parser(datagram);
		SerializeDataId command=parser.getName();
		switch(command){
			case GDATA_COMMAND_ADD_GPACK_RESOURCE:
			{
				std::string path=parser.getParam()->getString();
				int mouseX=parser.getParam()->getInt();
				int mouseY=parser.getParam()->getInt();
				addGPKResource(path);
				break;
			}
			case GDATA_COMMAND_ADD_RESOURCE:
				addResource(parser.getParam()->getString());
				break;
			case GDATA_COMMAND_ADD_CHR_MODEL:
				addCharacterModel(parser.getParam()->getString());
				break;
			case GDATA_COMMAND_CREATE_OBJECT:
				createObject(parser.getParam()->getObjectType());
				break;
			default:
				break;
		}
		delete datagram;
		*/
	}

	void NgExecutor::addCharacterModel(std::string path)
	{
		assert(false);
		//SEngine.addCharacterModel(path);
	}

	void NgExecutor::addResource(std::string path)
	{
		assert(false);
		//SEngine.addResource(path);
	}

	GameObject* NgExecutor::addGPKResource(std::string path)
	{
		assert(false);
		return 0;
		//return SEngine.addGPKResource(path);
	}

	void NgExecutor::createObject(ObjectType type)
	{
		assert(!"Not implemented!");
	}

}
